﻿#
import requests
import json

import sys  
reload(sys)  
sys.setdefaultencoding('utf-8')  

req = requests.session()
url = "http://123.207.160.131/10/index.php"

data = req.get(url)
print data.text
p = req.findall(r"<span>(.*)</span>", data.text)[0]
print p
a = p[0:5]
b= p[6:9]
c= p[10:13]
d= p[14:19]
sum = int(a)+ int(b)* int(c)- int(d)
print sum
data = {'sum':sum}
res = req.get(url+"?sum="+str(sum))
print res.text

exit(0)